package lumis.doui.table.filter;

import lumis.doui.source.filter.ISourceFilter;
import lumis.doui.source.filter.RequiredFilterValueException;
import lumis.doui.table.TableSource;
import lumis.portal.PortalException;
import lumis.portal.stability.StableMinor;
import lumis.util.parameter.IParameters;
import lumis.util.query.IQueryFilter;
import lumis.util.query.QueryBase;

/**
 * Defines the methods of a table source filter. Implementations of this interface 
 * are not expected to be thread-safe.
 * @since 4.0.5
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 */
@StableMinor(version = "6.0", sinceVersion = "4.0")
public interface ITableSourceFilter extends ISourceFilter<TableSource>
{
	/**
	 * Returns the query filter to be used with the given query.
	 * @param queryBase the query.
	 * @param parameters the parameters to be used for the filter.
	 * @return the query filter.
	 * @throws RequiredFilterValueException when a required value for the filter
	 * was not given. No results should be shown when this happen.
	 * @throws PortalException
	 * @since 4.0.5
	 */
	public IQueryFilter getQueryFilter(QueryBase queryBase, IParameters parameters) throws PortalException, RequiredFilterValueException;
	
	public ITableSourceFilter getFilter(String filterId) throws PortalException;
	
}
